class Solution:
    def grayCode(self, n: int):
        return [i ^ i >> 1 for i in range(2 ** n)]


a = Solution()
print(a.grayCode(0))
print(a.grayCode(1))
print(a.grayCode(2))
print(a.grayCode(3))
print(a.grayCode(11))